#include "comm.hpp"


int main()
{
    int shmid = GetShm();

    char* shmaddr = (char*)shmat(shmid, nullptr, 0);
    std::cout << "进程b 挂接到进程地址空间" << std::endl;
    //sleep(10);

    //写
    while(1)
    {
        std::cout << "Please Enter& ";
        fgets(shmaddr, 4096, stdin);
    }

    // 断开联系
    shmdt(shmaddr);
    std::cout << "进程b 断开联系" << std::endl;

    return 0;
}
